<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      html,
      body,
      #outer img {
        margin: 0;
        padding: 0;
      }
      #outer {
        width: 560px;
        margin: 0 auto;
        border: 1px solid red;
        text-align: center;
        font-size: 0;
        padding: 0 0 10px 10px;
        overflow: hidden;
        zoom: 1;
      }
      #outer img {
        border: 1px solid black;
        margin: 10px 10px 0 0;
        cursor: crosshair;
        opacity: 0.5;
        filter: alpha(opacity=50);
      }
    </style>
  </head>
  <body>
    <div id="outer">
      <img src="1.jpg" alt="兰博基尼" />
      <img src="1.jpg" alt="兰博基尼" />
      <img src="1.jpg" alt="兰博基尼" />
      <img src="1.jpg" alt="兰博基尼" />
      <img src="1.jpg" alt="兰博基尼" />
      <img src="1.jpg" alt="兰博基尼" />
      <img src="1.jpg" alt="兰博基尼" />
      <img src="1.jpg" alt="兰博基尼" />
    </div>
  </body>
</html>
<script>
  window.onload = function () {
    var oImg = document.getElementsByTagName("img");
    for (var i = 0; i < oImg.length; i++) {
      oImg[i].onmouseover = function () {
        this.style.cssText = "opacity:1.0;filter:alpha(opacity:100)";
      };
      oImg[i].onmouseout = function () {
        this.style.cssText = "";
      };
    }
  };
</script>
